/**
 * outsider.com.cn Inc.
 * Copyright (c) 2011-2022 All Rights Reserved.
 */
package com.yuanmeng.common.core.enums;

import com.yuanmeng.common.core.exception.ServiceException;

import lombok.Getter;

/**
 * @author outsider
 * @version Id: StatusEnum.java, v 0.1 2022/6/1 17:16 outsider Exp $$
 */
@Getter
public enum ModuleLevelEnum {
    HOME("HOME", "首页"),

    FIRST("FIRST", "一级"),

    SECOND("SECOND", "二级");

    private String code;

    private String message;

    ModuleLevelEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static void validateModuleLevel(String moduleLevel) {
        int num = 0;
        for (ModuleLevelEnum ENUM : ModuleLevelEnum.values()) {
            if (ENUM.code.equals(moduleLevel)) {
                num++;
            }
        }
        if (num == 0) {
            throw new ServiceException("请求参数非法：moduleLevel");
        }
    }
}